from typing import Dict, Any, List
from .base_service_handler import BaseServiceHandler, ServiceHandlerFactory

class RemoteDesktopServiceHandler(BaseServiceHandler):
    """远程桌面服务信息处理器"""
    
    def get_service_details(self, service_info: Dict[str, Any]) -> List[str]:
        """获取远程桌面服务的详细信息"""
        details = []
        
        # 基本信息
        if service_info.get('product'):
            details.append(f"产品: {self._safe_str(service_info['product'])}")
        if service_info.get('version'):
            details.append(f"版本: {self._safe_str(service_info['version'])}")
        if service_info.get('banner'):
            details.append(f"Banner: {self._safe_str(service_info['banner'])}")
            
        # 远程桌面特定信息
        if service_info.get('security_level'):
            details.append(f"安全级别: {self._safe_str(service_info['security_level'])}")
        if service_info.get('encryption_level'):
            details.append(f"加密级别: {self._safe_str(service_info['encryption_level'])}")
        if service_info.get('auth_methods'):
            details.append(f"认证方式: {', '.join(map(self._safe_str, service_info['auth_methods']))}")
        if service_info.get('os_info'):
            details.append(f"操作系统信息: {self._safe_str(service_info['os_info'])}")
            
        return details

# 注册远程桌面服务处理器
for rdp_type in ['rdp', 'vnc']:
    ServiceHandlerFactory.register_handler(rdp_type, RemoteDesktopServiceHandler) 